<?php
declare (strict_types = 1);
namespace app\wx\traits;
use think\facade\Config;
use EasyWeChat\Factory;
/**
 * 微信公众号API封装
 */
trait OfficialAccount {
    protected $app;
    private $app_config;
    /**
     * 配置函数
     */
    public function initWx(){
        $this->app_config = Config::get('wechat.officialaccount');
        $this->app = Factory::officialAccount($this->app_config);
    }
    /**
     * 获取配置信息
     *
     * @return array
     */
    public function get_config():array {
        return $this->app_config;
    }
}